<?php use_helper('jQuery')?>

<div id="main_header" class="ui-widget-header ui-corner-all">
    <h3>Datos del Boton de Servicio: "<?php echo $button->getType() ?>"</h3>
</div>
<div id="main_content" class="ui-widget ui-widget-content ui-corner-all">
    <table>
        <?php if($sf_user->hasCredential('Editar boton de servicio')): ?>
            <tfoot>
                <tr>
                    <td colspan="2">
                        <?php echo jq_link_to_remote(
                                '<span class="ui-button-icon-primary ui-icon ui-icon-pencil"></span>
                                <span class="ui-button-text">Editar</span>',
                            array(
                                'update' => 'main',
                                'url' => url_for('servicebutton_edit',$button),
                                'before'   => 'clearView();showLoaderMain();',
                                'complete' => 'hideLoader();'
                            ),
                            array(
                                'class' => 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary',
                                'title' => 'Editar'
                            ))
                        ?>
                    </td>
                </tr>
            </tfoot>
        <?php endif; ?>
      <tbody>
        <tr>
            <th>Servicio:</th>
            <td><?php echo $button->getType() ?></td>
        </tr>
        <tr>
            <th>Icono pequeño:</th>
            <td>
              <img alt="<?php echo $button->getThumbSmall() ?>" src="<?php echo '/uploads/portal_'.$button->getPortalId().'/images/'.$button->getThumbSmall()?>">
            </td>
        </tr>
        <tr>
            <th>Icono grande:</th>
            <td>
              <img alt="<?php echo $button->getThumbBig() ?>" src="<?php echo '/uploads/portal_'.$button->getPortalId().'/images/'.$button->getThumbBig()?>">
            </td>
        </tr>
        <?php if($button->getType()->getUsesMessage()): ?>
            <tr>
                <th>Mensaje:</th>
                <td style="border: solid 3px #5C9CCC"><?php echo html_entity_decode($button->getMessage()) ?></td>
            </tr>
        <?php endif; ?>
        <tr>
            <th>Publicado:</th>
            <td>
                <?php if($button->getPublished()): ?>
                    <img alt="Sí" src="/images/util/check.png"/>
                <?php else: ?>
                    <img alt="No" src="/images/util/cross.png"/>
                <?php endif; ?>
            </td>
        </tr>
        </tbody>
    </table>
</div>